package com.pro.controller;

import com.pro.pojo.JsonData;
import com.pro.service.JsUserDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 祖铭泽
 * @Date 2022/1/20/0020
 * @description 用户 部门表 控制层
 */
@RequestMapping("/userDept")
@Controller
public class JsUserDeptController {
    @Autowired
    private JsUserDeptService jsUserDeptService;
    /**
     * @Author 祖铭泽
     * @Date 2022/1/20/0020
     * @description 根据用户id查询用户所在部门
     */
    @ResponseBody
    @RequestMapping(value = "/getDeptsByUserId")
    public JsonData getDeptsByUserId(Integer userId) {
        return jsUserDeptService.getDeptsByUserId(userId);
    }
}
